package cn.rtangyy.seckilling.config;

import cn.rtangyy.seckilling.entity.User;

/**
 * 存储用户信息到线程中
 */
public class UserContext {
    private static ThreadLocal<User> userHolder = new ThreadLocal<User>();

    public static void setUser(User user) {
        userHolder.set(user);
    }

    public static User getUser() {
        return userHolder.get();
    }
}
